package com.lingjtx.common.core.constant;

public enum DateField {

    ERA(0),
    YEAR(1),
    MONTH(2),
    WEEK_OF_YEAR(3),
    WEEK_OF_MONTH(4),
    DAY_OF_MONTH(5),
    DAY_OF_YEAR(6),
    DAY_OF_WEEK(7),
    DAY_OF_WEEK_IN_MONTH(8),
    AM_PM(9),
    HOUR(10),
    HOUR_OF_DAY(11),
    MINUTE(12),
    SECOND(13),
    MILLISECOND(14);

    private int value;

    DateField(int value) {
        this.value = value;
    }

    public int getValue() {
        return this.value;
    }

    public static DateField of(int value) {
        for (DateField dateField : values()) {
            if (dateField.getValue() == value) {
                return dateField;
            }
        }
        return MILLISECOND;
    }
}
